package com.qf.es2203.esvo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "sms-logs-index",type = "sms-logs-type",shards = 1,replicas = 1,createIndex = false)
public class SmsLogs {

    @Id
    @Field(type = FieldType.Long)
    private Long id;// 唯一ID 1
    @Field(type = FieldType.Date)
    private Date createDate;// 创建时间
    @Field(type = FieldType.Date)
    private Date sendDate; // 发送时间
    @Field(type = FieldType.Keyword)
    private String longCode;// 发送的长号码
    @Field(type = FieldType.Keyword)
    private String mobile;// 下发手机号
    @Field(type = FieldType.Keyword)
    private String corpName;// 发送公司名称
    @Field(type = FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String smsContent; // 下发短信内容
    @Field(type = FieldType.Integer)
    private Integer state; // 短信下发状态 0 成功 1 失败
    @Field(type = FieldType.Integer)
    private Integer operatorId; // '运营商编号 1 移动 2 联通 3 电信
    @Field(type = FieldType.Keyword)
    private String province;// 省份
    @Field(type = FieldType.Ip)
    private String ipAddr; //下发服务器IP地址
    @Field(type = FieldType.Integer)
    private Integer replyTotal; //短信状态报告返回时长（秒）
    @Field(type = FieldType.Integer)
    private Integer fee;  // 费用
}
